﻿using Coldairarrow.Entity.DTO;
using Coldairarrow.Entity.PB;
using Coldairarrow.Util;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.PB
{
    public partial interface IPB_MaterialTypeBusiness
    {
        Task<PageResult<PB_MaterialType>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task<PB_MaterialType> GetTheDataAsync(string id);
        List<tmpMaterialTypeDTO> GetTheDataByCode(List<tmpMaterialTypeDTO> list);
        List<tmpUnitGroupDTO> GetTheDataByName(List<tmpUnitGroupDTO> list);
        Task AddDataAsync(PB_MaterialType data);
        Task UpdateDataAsync(PB_MaterialType data);
        Task DeleteDataAsync(List<string> ids);
        Task AddDataExlAsync(List<PB_MaterialType> list);
        Task<List<PB_MaterialTypeTreeDTO>> GetTreeDataListAsync(PB_MaterialTypeTreeInputDTO input);
        Task<List<PB_MaterialTypeTreeDTO>> GetTreeDataLists(PB_MaterialTypeTreeInputDTO input);
        /// <summary>
        /// 获取物料分类
        /// </summary>
        /// <param name="ParentId">父节点Id</param>
        /// <returns></returns>
        Task<List<MaterialType>> GetMaterialTypeListAsync(string ParentId);
        Task<List<PB_MaterialTypeTreeDTO>> GetTreeDataListAsyncs(PB_MaterialTypeTreeInputDTO input);
    }

    public class MaterialType
    {
        /// <summary>
        /// 物料类型ID
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 物料类型名称
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 物料类型ID
        /// </summary>
        public string value { get; set; }

        /// <summary>
        /// 物料类型ParentId
        /// </summary>
        public string ParentId { get; set; }

        /// <summary>
        /// 是否有下级分类
        /// </summary>
        public bool? isLeaf { get; set; }

        /// <summary>
        /// 物料分类code
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }
    }

}